/**
 * 
 */
package com.revenco.bi.controller;

import org.nutz.dao.pager.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.revenco.bi.controller.basecontroller.AbstractUserAwareController;
import com.revenco.bi.service.TnChartParamsService;

/**
 * 筛选条件
 * 
 * @author zhaozz
 * 
 */
@Controller
public class ConditionFilterController extends AbstractUserAwareController {
	@Autowired
	TnChartParamsService tnChartParamsService;

	@RequestMapping(value = "/chart/defaultValue", produces = "text/plain;charset=UTF-8")
	@ResponseBody
	public String getDefaultValue(String table, String column, String columnId,
			String colType, int start, int limit) throws Exception {
		Pager pager = new Pager();
		pager.setPageNumber(start / limit + 1);
		pager.setPageSize(limit);
		String defaultValue = tnChartParamsService.getDefaultValue(table,
				column, columnId, colType, pager);
		return defaultValue;
	}

}
